<!DOCTYPE html>
{include file='head_hooks.html'}

<head>
  <title>Home | Protoweb</title>

  {include file='head_scripts.html'}
</head>

<body>
  {include file='body_hooks.html'}

  {include file='navbar.html'}

  <div class="container">

    {include file='messages.html'}
    
    <div class="row">

      <section class="span8">
        <h1>User's Home</h1>
        <p>Make projects. Share and work with your people arround the World.</p>

        <h1>Active projects</h1>

        {if $active_projects != 0}
          {foreach from=$active_projects item="project"}
            <div class="control-group">
              <p><strong>{$project->name|escape}</strong>: {$project->description|escape}</p>
              <p>
                <a href="projects/dashboard/{$project->id}/" class="btn btn-primary">Edit</a>
                <a href='projects/deactivate/{$project->id}/' class='btn'>Deactivate</a>
              </p>
            </div>
          {/foreach}
        {else}
          <div class="control-group">
            <p>You haven't Active Projects</p>
          </div>
        {/if}

        <h1>Inactive projects</h1>

        {if $inactive_projects != 0}
          {foreach from=$inactive_projects item="project"}
            <div class="control-group">
              <p><strong>{$project->name|escape}</strong>: {$project->description|escape}</p>
              <p>
                <a href="projects/activate/{$project->id}/" class="btn btn-primary">Activate</a>
                <a class="btn" data-delete="true" data-projectname="{$project->name}" href="projects/delete/{$project->id}/">Delete</a>
              </p>
            </div>
          {/foreach}
        {else}
          <div class="control-group">
            <p>You haven't Inactive Projects</p>
          </div>
        {/if}

      </section>
      <!-- span8 -->

      <section class="span4">
        <h2>You need a profile to work with Protoweb.</h2>
        <p>Your personal information will be share to your team projects contacts, but never be to share to unknow people.</p>
        <a data-toggle="modal" data-target="#prpjects_create" href="projects/create/" class="btn btn-primary">Create a Project</a>
      </section>
      <!-- span4 -->

    </div>
    <!-- row -->

    {include file='footer.html'}

  </div> <!-- /container -->

  <!-- Create a Project's Modal -->
  <div class="modal hide fade" id="prpjects_create" tabindex="-1" role="dialog" data-remote="projects/create/">
    <div class="modal-body reset-modal-body"></div>
  </div>

  {include file='footer_scripts.html'}
  <script src="assets/js/libs/jquery.blockUI.js"></script>
  <script src="assets/js/user_dashboard.js"></script>
</body>

</html>
